package com.edu.service.impl;

import java.util.List;

import com.edu.bean.Comment;
import com.edu.bean.Page;
import com.edu.bean.Upkeep;
import com.edu.dao.CommentDao;
import com.edu.dao.impl.CommentDaoImpl;
import com.edu.service.CommentService;

public class CommentServiceImpl implements CommentService {
	CommentDao cd = new CommentDaoImpl();
	@Override
	public Page<Comment> selectCommentAll(Comment comment,int pageNum, int pageSize) {
		List<Comment> listcomment = cd.selectCommentAll(pageNum, pageSize);
		int row = cd.selectCommenttotal(comment);
		Page<Comment> page = new Page(listcomment,pageNum,pageSize,row);
		return page;
	}

	@Override
	public int deleteCommentById(int Commentid) {
		// TODO Auto-generated method stub
		return cd.deleteCommentById(Commentid);
	}

	@Override
	public int updateComment(Comment comment) {
		// TODO Auto-generated method stub
		return cd.updateComment(comment);
	}

	@Override
	public Comment selectCommentById(int Commentid) {
		// TODO Auto-generated method stub
		return cd.selectCommentById(Commentid);
	}

	@Override
	public int addComment(Comment comment) {
		// TODO Auto-generated method stub
		return cd.addComment(comment);
	}

}
